<?php
$reserveListStr = Yii::t('BWeSport', 'Reserve list items');
$locationSearchStr = Yii::t('BWeSport', 'Location Search');
$keywordSearchStr = Yii::t('BWeSport', 'KeyWord Search');
$eventNameStr = Yii::t('BWeSport', 'Event Name');
$eventTypeStr = Yii::t('BWeSport', 'Event Type');
$startTimeStr = Yii::t('BWeSport', 'Start Time');
$endTimeStr = Yii::t('BWeSport', 'End Time');
$operateStr = Yii::t('BWeSport', 'Operate');
$modifyStr = Yii::t('BWeSport', 'Modify');
$newAddStr = Yii::t('BWeSport', 'New Add');
$deleteStr = Yii::t('BWeSport', 'Delete');
$app = Blyn::app()->getActiveApp();
?>
<style>
.ui-block-a, 
.ui-block-b, 
.ui-block-c 
{
background-color: lightgray;
border: 1px solid black;
//height: 100px;
font-weight: bold;
text-align: center;
padding: 10px;
}
</style>

  <div data-role="header">
  <h1>旅游管理</h1>
  </div>
<?php
$form = $this->beginWidget('CActiveForm', array(
    "id" => "findEventForm",
    'enableAjaxValidation' => FALSE,
    'htmlOptions' => array('enctype' => 'multipart/form-data'),
        ));
?>
<div data-role="content" style="padding:0px;">
   <p>活动列表：</p>
   <div class="ui-grid-b">
     <div class="ui-block-a"><span>名称</span></div>
     <div class="ui-block-b"><span>类型</span></div>
     <div class="ui-block-c"><span>操作</span></div>
   </div>
   <?php foreach ($eventList as $event) {
        $detailUrl = $control->getLinkUrl(array('name' => '修改','id' => 'showjqAddEvent'),array(
            'eventId' => $event->id));
       ?>
    <div class="ui-grid-b">
     <div class="ui-block-a" style="border: 1px solid black;background-color:white;font-weight:normal"> <a href="<?php echo $detailUrl;?>"><span><?php echo $event->getName(); ?></span></a></div>
     <div class="ui-block-b" style="border: 1px solid black;background-color:white;font-weight:normal"><span><?php echo $event->getGroup(array('parent' => BWEventGroup::EVENT_TYPE))->name;; ?> </span></div>
     <div class="ui-block-c" style="border: 1px solid black;background-color:white;font-weight:normal"><?php
                                $eventTypeName = $event->getGroup(array('parent' => BWEventGroup::EVENT_TYPE))->name;
                                switch($eventTypeName)
                                {
                                    case 'translate': $messageListView = 'showTranslationList'; break;
                                    case 'note': $messageListView = 'showTravelNotesList'; break;
                                    case 'food': $messageListView = 'showTravelFoodList'; break;
                                    case 'info': $messageListView = 'showTravelInfoList'; break;
                                    case 'ad': $messageListView = 'showTravelAdList'; break;
                                    default : $messageListView = 'showTranslationList';
                                }
                               $manageUrl = $control->getLinkUrl(array('name' => '管理','id' => 'showjqMessageList'), array('eventId' => $event->id,'messageListView'=>$messageListView));
//                            echo $control->getAjaxLink(array('name' => '管理', 'id' => 'showMessageList'), array('eventId' => $event->id,'messageListView'=>$messageListView,'htmlOptions' => array('enctype' => 'multipart/form-data')));
                               ?><span><a href="<?php echo $manageUrl; ?>">管理</a></span></div>
   </div>
   <?php } ?>
   <div data-role="controlgroup" data-type="horizontal" style="padding:1px;">
        <?php
        $newAddUrl = $control->getLinkUrl(array('name' => '$newAddStr','id' => 'showjqAddEvent'),array(
           'eventId' => 0));
        ?>
       <a href="<?php echo $newAddUrl; ?>" data-role="button"><?php echo $newAddStr; ?></a>   
    <a href="#" data-role="button">删除</a>
    </div>
 </div>
    <?php $this->endWidget(); ?>
<div data-role="footer" data-position="fixed" data-theme="a" class="ui-footer ui-bar-a ui-footer-fixed slideup ui-fixed-hidden" role="contentinfo">
  <h1 class="ui-title" role="heading" aria-level="1">Copyright billyn.net</h1>
  </div>